﻿@using hc.epm.DataModel.Business;
@using System.Collections.Generic;
@using hc.epm.Common
@using hc.Plat.Common.Extend;
@using hc.epm.ViewModel;
@model List<ChangeView>
@{
    ViewBag.Title = "变更信息";
}
<div class="contentData">
    <ul class="tab-list">
        <li id="Detail">基本信息</li>
        <li id="DetailApprovalConstitute">总批复构成</li>
        <li id="DetailProjectISP">工程服务商</li>
        <li id="DetailProjectMainPoint">工程要点</li>
        <li id="DetailTimeManage">工期管理</li>
        <li id="DetailMilestonePlan">工程节点</li>
        <li id="ScheduleInfo">进度跟踪</li>
        <li id="VisaInfo">签证信息</li>
        <li id="QuestionInfo">问题信息</li>
        <li id="ChangeInfo" class="active">变更信息</li>
        <li id="ContractInfo">合同信息</li>
        <li id="DetailCrossingsManage">外部手续</li>
        <li id="video">视频集成</li>
    </ul>
    <div style="margin-top:40px;">
        <table class="datalist" style="word-break:break-all;word-wrap:break-word">
            <thead>
                <tr>
                    <th width="40">序号</th>
                    <th>变更名称</th>
                    <th width="110">原项目款<br />(万元)</th>
                    <th width="110">调增额<br />(万元)</th>
                    <th width="110">调减额<br />(万元)</th>
                    <th width="110">变更金额<br />(万元)</th>
                    <th width="85">开始时间</th>
                    <th width="85">结束时间</th>
                    <th width="100">状态</th>
                </tr>
            </thead>
            <tbody>
                @if (Model != null && Model.Count() > 0)
                {
                    int index=0;
                    foreach (var item in Model)
                    {
                        index++;
                        <tr>
                            <td style="display:none">
                                <input type="hidden" class="inputId" data-id="@item.Id" />
                            </td>
                            <td>@index</td>
                            <td>@item.ChangeName</td>
                            <td>@item.TotalAmount.ToString("#0")</td>
                            <td>@(item.AddAmount == null ? "" : item.AddAmount.ToString("#0"))</td>
                            <td>@(item.ReduceAmount == null ? "" : item.ReduceAmount.ToString("#0"))</td>
                            <td>@item.ChangeAmount.ToString("#0")</td>
                            <td>@(item.ChangeStartTime == null ? "" : Convert.ToDateTime(item.ChangeStartTime).ToString("yyyy-MM-dd"))</td>
                            <td>@(item.ChangeEndTime == null ? "" : Convert.ToDateTime(item.ChangeEndTime).ToString("yyyy-MM-dd"))</td>
                            <td class="state">@(((ApprovalState)item.State).GetText())</td>
                        </tr>
                    }
                }
                else {
                    <tr>
                        <td colspan="9">暂无数据</td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>
<script>
    $(function () {
        $("#Detail").click(function () {
            window.location.href = 'Detail?projectId=@ViewBag.ProjectId';
        });
        $("#DetailApprovalConstitute").click(function () {
            window.location.href = 'DetailApprovalConstitute?projectId=@ViewBag.ProjectId';
        });
        $("#DetailProjectMainPoint").click(function () {
            window.location.href = 'DetailProjectMainPoint?projectId=@ViewBag.ProjectId';
        });
        $("#DetailTimeManage").click(function () {
            window.location.href = 'CKTimeLimitDetail?projectId=@ViewBag.ProjectId';
        });
        $("#DetailMilestonePlan").click(function () {
            window.location.href = 'DetailMilestonePlan?projectId=@ViewBag.ProjectId';
        });
        $("#DetailProjectISP").click(function () {
            window.location.href = 'DetailProjectISP?projectId=@ViewBag.ProjectId';
        });
        $("#DetailProjectData").click(function () {
            window.location.href = 'DetailProjectData?projectId=@ViewBag.ProjectId';
        });
        $("#ScheduleInfo").click(function () {
            window.location.href = 'ScheduleInfo?projectId=@ViewBag.ProjectId';
        });
        $("#ContractInfo").click(function () {
            window.location.href = 'ContractInfo?projectId=@ViewBag.ProjectId';
        });
        $("#VisaInfo").click(function () {
            window.location.href = 'VisaInfo?projectId=@ViewBag.ProjectId';
        });
        $("#QuestionInfo").click(function () {
            window.location.href = 'QuestionInfo?projectId=@ViewBag.ProjectId';
        });
        $("#DetailCrossingsManage").click(function () {
            window.location.href = 'CKProcedureDetail?projectId=@ViewBag.ProjectId';
        });
        $("#video").click(function () {
            window.location.href = 'Video?projectId=@ViewBag.ProjectId';
        });
    });
</script>

